import Home from '../Page/Home'
import Login from '../Page/Login'
import List from '../Page/List'
import Detail from '../Page/Detail'
import My from '../Page/My'
import { createBrowserRouter } from 'react-router-dom'

export const routes= createBrowserRouter([
    {
        path:'/',
        lazy:async()=>{
            const {default:Home}=await import('../Page/Home')
            return {element:<Home/>}
        }
    },
    {
        path:'/login',
        lazy:async()=>{
            const {default:Login}=await import('../Page/Login')
            return {element:<Login/>}
        }
    },
    {
        path:'/list',
        lazy:async()=>{
            const {default:List}=await import('../Page/List')
            return {element:<List/>}
        }
    },
    {
        path:'/detail',
        lazy:async()=>{
            const {default:Detail}=await import('../Page/Detail')
            return {element:<Detail/>}
        }
    },
    {
        path:'/my',
        lazy:async()=>{
            const {default:My}=await import('../Page/My')
            return {element:<My/>}
        }
    }
    
])